(1) Field of the Invention
The present invention relates to an image data coding device and an image data coding method for performing entropy coding on color image data, and to an image forming apparatus, a storage medium, and a program.
(2) Description of Related Art
In recent years, full-color image forming apparatuses that form full-color images have widely been put into practice. These full-color image forming apparatuses convert image data that correspond to three color components of R(red), G(green) and B(blue), for example, into image data whose color is expressed by brightness data and color data, each of which is represented by multiple bits. This kind of conversion is commonly called uniform color space conversion.
Examples of color systems for the color image data obtained using the uniform color space conversion are L*a*b* (hereafter, simply “Lab”) and L*u*v* specified by CIE, and YCrCb. In these color systems, L* data and Y data are brightness data for expressing brightness, and a*b* data, u*v* data, and CrCb data are color data for expressing color including hue, chroma, and color difference using a coordinate system. The conversion into such color systems that express a color of an image by brightness data and color data described above enables the density of the image to be adjusted simply by adjusting the brightness data. In view of this advantage, these color systems are widely employed in the field of image forming apparatuses.
On the other hand, image forming apparatuses that handle digital image data usually store the digital image data once in a storage unit such as an image memory, and read the digital image data from the storage unit to form an image. However, providing a larger-capacity storage unit increases the production cost of such an image forming apparatus. Therefore, it is common to code digital image data so as to compress the data before storing it into the storage unit, thereby preventing data amount in the storage unit from increasing.
An example of an image data coding method widely used in the field of image forming apparatuses is so called “entropy coding”. Examples of the entropy coding include arithmetic coding adopted by the Joint Bi-level Image Coding Experts Group (JBIG), and run-length coding, such as MH coding (Modified Huffman coding), MR coding (Modified READ coding), and MMR coding (Modified Modified READ coding). The entropy coding is to assign shorter code to a value that appears more frequently for reducing the entire code amount.
The following describes color image data coding, taking a color system of L*a*b* (hereinafter referred to as “Lab color system”) for expressing image data by brightness data and color data as one example. FIG. 1 is for explaining an image data coding method and its color data expressive forms in the Lab color system.
In the Lab color system, each color is specified by a point on a three-dimensional coordinate system which takes brightness data (L*) on one axis, and color data (a and b*) respectively on the other two axes. Note here that the brightness data and the color data are each represented by eight bits. Note also that the coordinate axes are respectively referred to as “L”, “a”, and “b”. Also, FIG. 1 assumes that coordinates for brightness data are on the axis that is perpendicular to the paper. In the figure, coordinates specifying color data in red and green directions (“a” coordinates) are on the horizontal axis, and coordinates specifying color data in yellow and blue directions (“b” coordinates) are on the vertical axis. The center “N” of the circle corresponds to achromatic color.
Typically, there are two types of expressive forms for values that show color data as shown in the figure. In the figure, the first expressive form (I) sets achromatic color at 00h (all 8 bits are 0), the maximum values in the red and yellow directions at 7Fh, and the maximum values in the green and blue directions at 80h. The second expressive form (II) sets the maximum values in the green and blue directions at 00h, and the maximum values in the red and yellow directions at FFh.
A conventional image data coding method is to perform the entropy coding, such as the arithmetic coding or the run-length coding, on color data expressed in one of forms (I) and (II) in pixel units, and then store the resulting data into a memory or the like.
However, an image forming apparatus such as a copying machine equipped with an image scanner that scans an original image using a plurality of CCD line sensors has the following problem. In such an image forming apparatus, the image scanner scans the original image by the CCD line sensors (hereafter, simply “line sensors”) for three reference colors of (red), G (green), and B (blue), and generates image data corresponding to respective color components of R, G, and B. The Lab conversion is then performed on the generated image data of RGB colors (hereafter referred to as “RGB data”) to obtain image data that can be expressed by the Lab color system (hereafter referred to as “Lab data”). The entropy coding is then performed on the obtained Lab data. Here, the problem lies in that there is a certain limit to the compression ratio of the Lab data expressed in either forms (I) or (II) that can be achieved using the entropy coding. The following describes this problem in more detail.
In the image scanner that scans the original color image using the line sensors for the three colors of R, G, and B, minute deviation might occur in the alignment of these line sensors. This may disturb the color balance of R, G, and detected by these line sensors in such a part where, e.g., colors change from white to black or vice versa. If this happens, the resulting RGB data might show a chromatic color in the part that is supposed to show an achromatic color (an example of this is disclosed in Japanese Laid-Open Patent Application No. 10-215381).
The RGB data showing a chromatic color means that color data showing the chromatic color will be produced when the RGB data is converted into Lab data. Referring now to FIG. 1, since a change from white to black, or black to white, is a change between achromatic colors, a shift should occur along the axis perpendicular to the paper (a change in brightness data) at the position of (position representing achromatic color) shown in the figure. However, when the color data showing the chromatic color is produced, there will be deviation in the value in the direction of the horizontal axis (a) or the vertical axis (b) from the position of N.
This deviation not only causes deterioration of the quality of the formed image, but also leads to decrease in the compression ratio of the image data coding. The reason for this can be considered as follows. In the entropy coding, the compression ratio normally increases with every increase in the proportion at which the same values are repeated. However, the deviation in the values of the color data described above decreases the proportion of the repeated data values.
For example, in the case of the form (I) in FIG. 1, the minimum value 00h for color data is adjacent to the maximum value FFh at the position of the aromatic color. Therefore, when deviation in color data occurs, a portion where 0 is repeated and a portion where 1 is repeated together constitute the bit sequence of the color data that is expressed by 8 bits per pixel. This causes decrease in the compression ratio of the entropy coding. While deviation in color data may occur in one direction (either red or green direction, or either yellow or blue direction), the deviation usually occurs in both directions. In the case of the form (I), in particular, the deviation in both directions causes significant decrease in the compression ratio.
The same problem also occurs in the case of the form (II), although it should be noted that the form (II) is not preferable in the first place. With the form (II), only a limited compression ratio can be achieved for a chromatic color data even when the RGB balance is not disturbed.